﻿using System;
using System.Web;

namespace GameAdmin.Classes
{
    internal class MySession
    {
        private MySession() { }

        internal static MySession Current
        {
            get
            {
                MySession session = (MySession)HttpContext.Current.Session["__MySession__"];
                if (session == null)
                {
                    session = new MySession();
                    HttpContext.Current.Session["__MySession__"] = session;
                }
                return session;
            }
        }

        private DateTime _dateSince;
        internal DateTime DateSince
        {
            get
            {
                if (_dateSince == DateTime.MinValue) _dateSince = new DateTime(2000, 1, 1);
                return _dateSince;
            }
            set
            {
                _dateSince = value;
            }
        }

        private DateTime _dateTill;
        internal DateTime DateTill
        {
            get
            {
                if (_dateTill == DateTime.MinValue) _dateTill = new DateTime(2050, 1, 1);
                return _dateTill;
            }
            set
            {
                _dateTill = value;
            }
        }
    }
}